package com.scs.application.modules.upms.vo;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.fastjson.JSONArray;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 */
@Data
@Accessors(chain = true)
public class UserVO implements Serializable {

    private String id;

    @Excel(name = "登录账号", width = 20)
    private String loginKey;

    private String password;

    @Excel(name = "昵称", width = 20)
    private String nickname;

    @Excel(name = "机构代码", width = 20)
    private String officeCode;

    private String officeId;

    @Excel(name = "机构名称", width = 20)
    private String officeName;

    @Excel(name = "启用状态", dict = "common_inactive")
    private Integer inactive;

    @Excel(name = "手机号", width = 15)
    private String mobile;

    @Excel(name = "邮箱", width = 20)
    private String email;

    private String isAdmin;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date gmtLastLogin;

    @Excel(name = "备注")
    private String remark;

    private JSONArray rolesId;

    private List<String> roleCodes;

    private List<String> permissions;

    public Boolean isAdmin(){
        return "1".equals(this.getIsAdmin());
    }
}
